package org.grumpybitz.sunrise;

import com.vaadin.data.Property;
import com.vaadin.ui.Table;

public class PersonList extends Table {
	/**
	 *
	 */
	private static final long serialVersionUID = 2431634173694476117L;

	public PersonList(MyVaadinApplication app) {
		setContainerDataSource(app.getDataSource());

		setVisibleColumns(CustomerContainer.NATURAL_COL_ORDER);
		setColumnHeaders(CustomerContainer.COL_HEADERS_ENGLISH);
		setSizeFull();
		/*
		 * Make table selectable, react immediatedly to user events, and pass
		 * events to the controller (our main application)
		 */
		setSelectable(true);
		setImmediate(true);
		addListener((Property.ValueChangeListener) app);
		/* We don't want to allow users to de-select a row */
		setNullSelectionAllowed(false);

	}
}